package com.goldplusgold.tradedelay.app.base.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.view.View;
import android.widget.TextView;

import com.goldplusgold.tradedelay.app.R;

/**
 * Created by Administrator on 2017/7/17.
 */

public class WifiHintDialog extends Dialog {

    private TextView stop_btn;
    private TextView resume_btn;
    private Context mContext;
    public WifiHintDialog(@NonNull Context context) {
        super(context);

        this.mContext = context;
    }

    public WifiHintDialog(@NonNull Context context, @StyleRes int themeResId) {
        super(context,R.style.AlertDialogStyle);
        this.mContext = context;
    }

    protected WifiHintDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        this.mContext = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_nowifi_layout);
        setCanceledOnTouchOutside(false);
        initView();
    }

    private void initView(){
        resume_btn = (TextView)findViewById(R.id.resume_btn);
        stop_btn = (TextView)findViewById(R.id.stop_btn);
        stop_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

    public void setResumeListener(View.OnClickListener listener){
        if(listener != null){
            resume_btn.setOnClickListener(listener);
            dismiss();
        }
    }
}
